<template>
  <div class="pc-token-infos">
    <div class="head flex-left">
      <img :src="infos.icon" />
      <span>{{infos.symbol}}</span>
      <span
        v-if="infos.nickname&&JSON.parse(infos.nickname)[lang]"
      >&nbsp;({{JSON.parse(infos.nickname)[lang]}})</span>
    </div>
    <div class="infos table-shadow">
      <h3 class="title">{{$t('blockDetail.general')}}</h3>
      <div class="detail">
        <div class="item">
          <p class="item-text flex-left">
            <img src="../../../assets/img/tip/red.png" alt />
            <span class="item-title">{{$t('tokenDetail.issueTotal')}}</span>
            <span>{{(infos.total/100000000||'')|filterNum}}</span>
          </p>
          <p class="item-text flex-left">
            <img src="../../../assets/img/tip/blue.png" alt />
            <span class="item-title">{{$t('tokenDetail.holder')}}</span>
            <span>{{infos.holders}}</span>
          </p>
        </div>
        <div class="item">
          <p class="item-text flex-left">
            <img src="../../../assets/img/tip/red.png" alt />
            <span class="item-title">{{$t('address.txCount')}}</span>
            <span>{{infos.txCount}}</span>
          </p>
          <p class="item-text flex-left">
            <img src="../../../assets/img/tip/blue.png" alt />
            <span class="item-title">{{$t('tokenDetail.issueTime')}}</span>
            <span>{{infos.createdTime|formatTime}}</span>
          </p>
        </div>
        <div class="item">
          <p class="item-text flex-left">
            <img src="../../../assets/img/tip/red.png" alt />
            <span class="item-title">{{$t('tokenDetail.point')}}</span>
            <span>8</span>
          </p>
          <p class="item-text flex-left">
            <img src="../../../assets/img/tip/blue.png" alt />
            <span class="item-title">{{$t('tokenDetail.value')}}</span>
            <span>￥{{Number(infos.rmb).toFixed(2)||0.00}}</span>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    infos: {
      type: Object,
      default: () => {
        return {
          icon: "",
          symbol: "",
          total: "",
          holders: "",
          txCount: "",
          createTime: "",
          ceilpoint: "",
          web: ""
        };
      }
    }
  },
  computed: {
    lang() {
      let language = "";
      switch (this.$store.state.initLang) {
        case "zh":
          language = "zh-CN";
          break;
        case "en":
          language = "en-US";
          break;
        case "ja":
          language = "ja";
          break;
        default:
          break;
      }
      return language;
    }
  }
};
</script>


<style lang="scss" scoped>
.pc-token-infos {
  .head {
    margin: 30px 0 10px;
    font-size: 16px;
    color: $black;
    font-family: PingFangSC-Semibold;
    img {
      width: 30px;
      margin-right: 10px;
    }
  }
  .infos {
    width: 100%;
    background: $white;
    border-radius: 2px;
    border: 1px solid rgba(235, 239, 241, 1);
    .title {
      height: 70px;
      line-height: 70px;
      padding-left: 30px;
      font-size: 16px;
      color: $black;
      border-bottom: 1px solid #eee;
    }
    .detail {
      .item {
        display: inline-block;
        width: calc(1177px / 3);
        height: 100%;
        border-right: 1px solid #eee;
        padding: 10px 0 10px 30px;
        color: $black;
        font-size: 14px;
        .item-text {
          padding: 10px 0;
          .item-title {
            width: 96px;
            margin-left: 20px;
          }
        }
      }
      .item:last-child {
        border: none;
      }
    }
  }
}
</style>

